class Result {
    // 是否成功
    final bool success;

    // 状态码
    final int code;

    // 提示信息
    final String msg;

    // 数据
    final dynamic data;

    // Authorization
    final String authorization;

    // Constructor to initialize from a map
    Result({
        required this.success,
        required this.code,
        required this.msg,
        required this.data,
        required this.authorization,
    });

    // Factory constructor to create a Result object from JSON
    factory Result.fromJson(Map<String, dynamic> json) {
        return Result(
            success: json["success"] ?? false,
            code: json["code"] ?? 404,
            msg: json["msg"] ?? "",
            data: json["data"] ?? "",
            authorization: json["authorization"] ?? "",
        );
    }

    // Convert the Result object to JSON
    Map<String, dynamic> toJson() {
        return {
            "success": success,
            "code": code,
            "msg": msg,
            "data": data,
            "authorization": authorization,
        };
    }
}
